package com.raymond.queue.common.msg.response;

import com.raymond.queue.common.enums.CommandIdType;

import java.util.List;

/**
 * 消费消息响应
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-07-17 15:32
 */
public class ConsumptionMsgResponse extends BaseResponseMessage {

    public ConsumptionMsgResponse(int sequenceId, int code) {
        super(sequenceId, code);
    }

    public ConsumptionMsgResponse(int sequenceId, List<byte[]> data) {
        super(sequenceId);
        this.data = data;
        if (data == null) {
            setCode(2);
        }
    }



    private List<byte[]> data;

    public List<byte[]> getData() {
        return data;
    }

    public void setData(List<byte[]> data) {
        this.data = data;
    }

    public void addData(byte[] data) {
        this.data.add(data);
    }


    @Override
    public int getCommandId() {
        return CommandIdType.CONSUMPTION_RESP.getCommandId();
    }
}
